using UnityEngine;

namespace BCW.GameTypes.SkyBlock
{
	public class SkyBlockBlockIcon : MonoBehaviour
	{
		public GameObject icon;

		private void Awake()
		{
			if (icon != null)
			{
				if (GameController.instance.curTypeGame != TypeGame.SkyBlock && GameController.instance.curTypeGame != TypeGame.Pixelmon)
				{
					base.enabled = false;
					icon.SetActive(false);
				}
			}
			else
			{
				base.enabled = false;
			}
		}

		private void Update()
		{
			if (SkyBlockController.instance != null && icon != null)
			{
				icon.SetActive(SkyBlockController.instance.hasFlag);
			}
			if (PixelmonController.instance != null && icon != null)
			{
				icon.SetActive(PixelmonController.instance.hasPixelmon);
			}
		}
	}
}
